import struct
import binascii

if __name__ == '__main__':
    hexstr = '6c 01'
    print hexstr
    hexstr = hexstr.replace(' ', '')
    binstr = binascii.a2b_hex(hexstr)
    print 'native order int16:', struct.unpack('h', binstr)[0]
    print 'network order int16:', struct.unpack('!h', binstr)[0]
    print 'native order uint16:', struct.unpack('H', binstr)[0]
    print 'network order uint16:',struct.unpack('!H', binstr)[0]

